import 'package:flutter_icons/flutter_icons.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluwx/fluwx.dart' as fluwx;

class LoginBottom extends StatefulWidget {
  @override
  _LoginBottomState createState() => _LoginBottomState();
}

class _LoginBottomState extends State<LoginBottom> {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        SizedBox(height: 10),
        Container(
          padding: EdgeInsets.only(left: 50.w, right: 50.w),
          child: Stack(
            children: <Widget>[
              Align(
                alignment: Alignment.centerLeft,
                child: Text('忘记密码'),
              ),
              Align(
                alignment: Alignment.centerRight,
                child: InkWell(
                  onTap: () {
                    Navigator.of(context).pushNamed('/registerFirst',
                        arguments: {'username': 123456});
                  },
                  child: Text('新用户注册'),
                ),
              ),
            ],
          ),
        ),
        Container(
          margin: EdgeInsets.only(left: 30, right: 30, top: 50),
          child: Row(
            children: <Widget>[
              Expanded(
                child: Container(
                  margin: EdgeInsets.only(right: 10),
                  height: 1,
                  color: Colors.grey,
                ),
              ),
              Text('快速登录'),
              Expanded(
                child: Container(
                  margin: EdgeInsets.only(left: 10),
                  height: 1,
                  color: Colors.grey,
                ),
              ),
            ],
          ),
        ),
        Container(
          margin: EdgeInsets.symmetric(
            horizontal: 30,
            vertical: 30,
          ),
          child: Row(
            children: <Widget>[
              Expanded(
                  child: InkWell(
                onTap: () {
                  fluwx
                      .sendWeChatAuth(
                          scope: "snsapi_userinfo",
                          state: "wechat_sdk_demo_test")
                      .then((data) {});
                },
                child: Column(
                  children: <Widget>[
                    Container(
                      width: 50,
                      height: 50,
                      decoration: BoxDecoration(
                          shape: BoxShape.circle,
                          border: Border.all(color: Colors.green)),
                      child:
                          Icon(AntDesign.wechat, size: 30, color: Colors.green),
                    ),
                    SizedBox(height: 20.h),
                    Text('微信登录')
                  ],
                ),
              )),
              Expanded(
                child: GestureDetector(
                  onTap: () {
                    Navigator.of(context).pushNamed('/fdsafasdf');
                  },
                  child: Column(
                    children: <Widget>[
                      Container(
                        width: 50,
                        height: 50,
                        child: Icon(AntDesign.alipay_circle,
                            size: 30, color: Colors.blue),
                        decoration: BoxDecoration(
                            shape: BoxShape.circle,
                            border: Border.all(color: Colors.blue)),
                      ),
                      SizedBox(height: 20.h),
                      Text('支付宝登陆')
                    ],
                  ),
                ),
              ),
            ],
          ),
        ),
      ],
    );
  }
}
